package Java7_Concurrency_Cookbook.concurrency_test.use_logging;

import java.io.IOException;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;

/**
 * @author lixiangke
 * @date 2017/12/5
 */
public class Task implements Runnable {
    @Override
    public void run() {
        try {
            Logger logger = MyLogger.getLogger(this.getClass().getName());
            logger.entering(Thread.currentThread().getName(), "run");
            TimeUnit.SECONDS.sleep(2);
            logger.exiting(Thread.currentThread().getName(), "run", Thread.currentThread());
        } catch (IOException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
